{extend name="public/base" /} {block name="title"}
<title>邮箱投稿</title>
<meta name="keywords" content="{:config('web.site_keywords')}">
<meta name="description" content="{:config('web.site_description')}"> {__block__}
<script>
    var sendEmailUrl = "{:url('index/action/sendEmail')}";
    var indexEmailUrl = "{:url('index/index/email')}";
</script>
{/block} {block name="content"}
<div class="col-sm-8">
    <div class="ibox">
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="text-center article-title">
                        <h1>
                            邮箱投稿
                        </h1>
                        <hr/>
                    </div>
                    <div class="content">
                        <form class="form-horizontal" role="form" id="emailForm">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">收件人</label>
                                <div class="col-sm-10">
                                    <p class="form-control-static">{:config('web.mail')}/{:config('web.site_author')}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">主题</label>
                                <div class="col-sm-10">
                                    <input type="text" name="subject" id="subject" class="form-control" placeholder="在此输入主题">
                                </div>
                            </div>
                            <div class=" form-group">
                                <label class="col-sm-2 control-label">内容</label>
                                <div class="col-sm-10">
                                    <div class="editor">
                                        <div id="toolbar" class="toolbar">
                                        </div>
                                        <div id="text" class="textcontent">
                                        </div>
                                    </div>
                                    <textarea id="content" name="content" style="display:none"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">点击刷新</label>
                                <div class="col-sm-10">
                                    <img src="{:captcha_src()}" alt="captcha" width="50%" height="50%" onclick="this.src='{:captcha_src()}'">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">验证码</label>
                                <div class="col-sm-10">
                                    <input type="text" name="captcha" id="captcha" class="form-control" placeholder="请输入验证码">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-10 col-sm-offset-2">
                                    <button type="submit" class="btn btn-primary">发送</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block} {block name="script"}{__block__}
<script src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script>
<script>
    var E = window.wangEditor
    var editor = new E('#toolbar', '#text')
    editor.customConfig.zIndex = 100
    editor.customConfig.customAlert = function (info) {
        swal('自定义提示', info, 'error')
    }
    editor.customConfig.onchange = function (html) {
        $('#content').val(html);
        // console.log($('#content').val());
    }
    editor.create()
    $('.w-e-toolbar').css('flex-wrap', 'wrap');
</script>
{/block}